package com.oocl.euc.core.maintenance.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.oocl.euc.audit.AuditEntity;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "PCRS_SUPPORT_GROUPS")
@SequenceGenerator(name = "SEQUENCE_GENERATOR", sequenceName = "SUPPORT_GROUPS_SEQUENCE", allocationSize = 1)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
public class SupportGroup extends AuditEntity {

    @Column(name = "GROUP_NAME", length = 30)
    private String groupName;

    @Column(name = "GROUP_DESC", length = 100)
    private String groupDesc;

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "SUPPORT_GROUP_ID", referencedColumnName = "ID")
    private List<SupportGroupMembers> supportGroupMembers;

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getGroupDesc() {
        return groupDesc;
    }

    public void setGroupDesc(String groupDesc) {
        this.groupDesc = groupDesc;
    }

    public List<SupportGroupMembers> getSupportGroupMembers() {
        return supportGroupMembers;
    }

    public void setSupportGroupMembers(List<SupportGroupMembers> supportGroupMembers) {
        this.supportGroupMembers = supportGroupMembers;
    }
}
